<template>
  <div class="vue">
    <el-button type='success' @click="search()">查询</el-button>

    <el-button type="primary" class="button" @click="click">按钮</el-button>

    <span>{{count}}</span>

  </div>
</template>

<script>
import screenfull from "screenfull";
export default {
  name: 'vuex',
  data () {
    return {
      count: 0,

    }
  },

  methods: {
    search () {
      this.$store.commit('increment')
      this.count = this.$store.getters.doneTodos

    },

    //点击函数
    click () {
      //判断是否支持
      if (!screenfull.enabled) {
        this.$message({
          message: "不支持全屏",
          type: "warning"
        });
        return false;
      }
      screenfull.toggle();
    }
  }
}
</script>

<style scoped>
.vue >>> .el-button--success {
  background-color: red;
}
</style>